
/* First created by JCasGen Thu Mar 17 15:01:54 CET 2011 */
package fr.univnantes.lina.uima.connectors.types;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;
import org.apache.uima.jcas.tcas.Annotation_Type;

/** 
 * Updated by JCasGen Fri Mar 18 22:36:43 CET 2011
 * @generated */
public class XMLElementAnnotation_Type extends Annotation_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (XMLElementAnnotation_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = XMLElementAnnotation_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new XMLElementAnnotation(addr, XMLElementAnnotation_Type.this);
  			   XMLElementAnnotation_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new XMLElementAnnotation(addr, XMLElementAnnotation_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = XMLElementAnnotation.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
 
  /** @generated */
  final Feature casFeat_elementName;
  /** @generated */
  final int     casFeatCode_elementName;
  /** @generated */ 
  public String getElementName(int addr) {
        if (featOkTst && casFeat_elementName == null)
      jcas.throwFeatMissing("elementName", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    return ll_cas.ll_getStringValue(addr, casFeatCode_elementName);
  }
  /** @generated */    
  public void setElementName(int addr, String v) {
        if (featOkTst && casFeat_elementName == null)
      jcas.throwFeatMissing("elementName", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    ll_cas.ll_setStringValue(addr, casFeatCode_elementName, v);}
    
  
 
  /** @generated */
  final Feature casFeat_attributeNames;
  /** @generated */
  final int     casFeatCode_attributeNames;
  /** @generated */ 
  public int getAttributeNames(int addr) {
        if (featOkTst && casFeat_attributeNames == null)
      jcas.throwFeatMissing("attributeNames", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    return ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames);
  }
  /** @generated */    
  public void setAttributeNames(int addr, int v) {
        if (featOkTst && casFeat_attributeNames == null)
      jcas.throwFeatMissing("attributeNames", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    ll_cas.ll_setRefValue(addr, casFeatCode_attributeNames, v);}
    
   /** @generated */
  public String getAttributeNames(int addr, int i) {
        if (featOkTst && casFeat_attributeNames == null)
      jcas.throwFeatMissing("attributeNames", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i);
  return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i);
  }
   
  /** @generated */ 
  public void setAttributeNames(int addr, int i, String v) {
        if (featOkTst && casFeat_attributeNames == null)
      jcas.throwFeatMissing("attributeNames", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i);
    ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeNames), i, v);
  }
 
 
  /** @generated */
  final Feature casFeat_attributeValues;
  /** @generated */
  final int     casFeatCode_attributeValues;
  /** @generated */ 
  public int getAttributeValues(int addr) {
        if (featOkTst && casFeat_attributeValues == null)
      jcas.throwFeatMissing("attributeValues", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    return ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues);
  }
  /** @generated */    
  public void setAttributeValues(int addr, int v) {
        if (featOkTst && casFeat_attributeValues == null)
      jcas.throwFeatMissing("attributeValues", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    ll_cas.ll_setRefValue(addr, casFeatCode_attributeValues, v);}
    
   /** @generated */
  public String getAttributeValues(int addr, int i) {
        if (featOkTst && casFeat_attributeValues == null)
      jcas.throwFeatMissing("attributeValues", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i);
  return ll_cas.ll_getStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i);
  }
   
  /** @generated */ 
  public void setAttributeValues(int addr, int i, String v) {
        if (featOkTst && casFeat_attributeValues == null)
      jcas.throwFeatMissing("attributeValues", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i);
    ll_cas.ll_setStringArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributeValues), i, v);
  }
 
 
  /** @generated */
  final Feature casFeat_attributes;
  /** @generated */
  final int     casFeatCode_attributes;
  /** @generated */ 
  public int getAttributes(int addr) {
        if (featOkTst && casFeat_attributes == null)
      jcas.throwFeatMissing("attributes", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    return ll_cas.ll_getRefValue(addr, casFeatCode_attributes);
  }
  /** @generated */    
  public void setAttributes(int addr, int v) {
        if (featOkTst && casFeat_attributes == null)
      jcas.throwFeatMissing("attributes", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    ll_cas.ll_setRefValue(addr, casFeatCode_attributes, v);}
    
   /** @generated */
  public int getAttributes(int addr, int i) {
        if (featOkTst && casFeat_attributes == null)
      jcas.throwFeatMissing("attributes", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i);
  }
   
  /** @generated */ 
  public void setAttributes(int addr, int i, int v) {
        if (featOkTst && casFeat_attributes == null)
      jcas.throwFeatMissing("attributes", "fr.univnantes.lina.uima.connectors.types.XMLElementAnnotation");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_attributes), i, v);
  }
 



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public XMLElementAnnotation_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_elementName = jcas.getRequiredFeatureDE(casType, "elementName", "uima.cas.String", featOkTst);
    casFeatCode_elementName  = (null == casFeat_elementName) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_elementName).getCode();

 
    casFeat_attributeNames = jcas.getRequiredFeatureDE(casType, "attributeNames", "uima.cas.StringArray", featOkTst);
    casFeatCode_attributeNames  = (null == casFeat_attributeNames) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_attributeNames).getCode();

 
    casFeat_attributeValues = jcas.getRequiredFeatureDE(casType, "attributeValues", "uima.cas.StringArray", featOkTst);
    casFeatCode_attributeValues  = (null == casFeat_attributeValues) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_attributeValues).getCode();

 
    casFeat_attributes = jcas.getRequiredFeatureDE(casType, "attributes", "uima.cas.FSArray", featOkTst);
    casFeatCode_attributes  = (null == casFeat_attributes) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_attributes).getCode();

  }
}



    